<!DOCTYPE html>
<html lang="en">
<!--header-->
<include file="Public:header"/>

<!--header-->
<section id="main-content">
    <section class="wrapper">
        <h3><i class="fa fa-angle-right"></i> 添加/修改分类信息</h3>
        <a class="btn btn-theme btn-default" href="{:U('pi',array('currpage'=>$currpage))}">返回</a>

        <!-- BASIC FORM ELELEMNTS -->
        <div class="row mt">
            <div class="col-lg-12">
                <div class="form-panel">
                    <h4 class="mb"><i class="fa fa-angle-right"></i> 美容管理分类信息</h4>
                    <form  id="myForm" class="form-horizontal style-form" method="post" action="{:U('upload')}"  enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">美容一级类别</label>
                            <div class="col-sm-10">
                                <select id="pid" name="pid" class="form-control">
                                    <option value="0">添加顶级美容分类</option>
                                    <foreach name="pid" item="v">
                                        <option value="{$v.id}" <if condition="$list['pid'] == $v['id']">selected</if>>{$v.name}</option>
                                        <foreach name="v.children" item="va">
                                            <option value="{$va.id}" <if condition="$list['pid'] == $va['id']">selected</if>>——{$va.name}</option>
                                        </foreach>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">分类名称</label>
                            <div class="col-sm-10">
                                <input id="name" name="name" value="{$list.name}" type="text"  class="form-control" placeholder="请输入分类名称">
                            </div>
                        </div>
                        <input type="hidden" id="id" name="id" value="{$list.id}">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label"></label>
                            <div class="col-sm-10">
                                <input  type="button" id="tianjia" class="btn btn-theme" value="保存" style="width: 150px;">
                                <input  type="reset" class="btn btn-warning" value="重置" style="width: 150px">
                            </div>
                        </div>
                    </form>
                </div>
            </div><!-- col-lg-12-->
        </div><!-- /row -->
    </section>
</section>
<!--footer-->
<include file="Public:footer"/>
<!--footer-->
<script type="text/javascript" src="__PUBLIC__/ui/lib/layer/2.4/layer.js"></script>
<script>
    $("#tianjia").click(function(){
        var name  =  $("#name").val();
        if(name ==''){
            layer.open({
                title: '添加/修改提示：',content: '美容分类信息请填写完整'
            });
        }else{
            $("#myForm").submit();
        }
    });
</script>
</body>
</html>
